<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./../../template.xhtml">

            <ui:define name="title">CS - Membro</ui:define>
            
            <ui:define name="mainMenu">
                <ui:include src="./../../mainMenu.xhtml" />
            </ui:define>
            
            <ui:define name="subtitle"><h:outputLabel value="Membro > Listar membro"/></ui:define>

            <ui:define name="leftMenu">
                <ui:include src="menuMembro.xhtml" />
            </ui:define>
            
            <ui:define name="content">
                <center>
                    <h4><h:outputLabel value="Lista"/></h4>
                </center>
                <p/>
                <h:form>                    
                    <div align="right">
                        <h:selectOneMenu id="filterName" value="#{membroMB.filterName}" >
                            <f:selectItem itemLabel="Nome" itemValue="Nome" />
                            <f:selectItem itemLabel="Id" itemValue="id" />
                        </h:selectOneMenu>

                        <h:inputText id="filterValue" size="30" value="#{membroMB.filterValue}" />
                        <h:commandButton value="Filtrar" action="#{membroMB.filtrar}" />
                    </div>
                    
                    <p/>
                    <div id="divOptionPage">
                        <h:commandLink action="formMembro" >
                            <h:graphicImage library="imagens" name="create.ico" alt="Adicionar" title="Adicionar"/>
                        </h:commandLink>
                       <!-- <h:commandLink actionListener="#{categoriaMB.PDF}" >
                            <h:graphicImage library="imagens" name="pdf.ico" alt="PDF" title="PDF"/>
                        </h:commandLink>
                        <h:commandLink actionListener="#{categoriaMB.XML}" >
                            <h:graphicImage library="imagens" name="xml.ico" alt="XML" title="XML"/>
                        </h:commandLink>-->
                    </div>
                    <p/>
   
                    
                    <!-- BEGIN - tabela prime faces -->                  
                    <p:dataTable id="dataTable" var="membro" value="#{membroMB.membros}"  
                                  paginator="true" rows="10"  
                                  paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                  rowsPerPageTemplate="5,10,15">  

                        <p:column sortBy="#{membro.matricula}">  
                             <f:facet name="header">  
                                 <h:outputText value="Matricula" />  
                             </f:facet>  
                             <h:outputText value="#{membro.matricula}" />  
                         </p:column>  

                        <p:column sortBy="#{membro.nome}">  
                             <f:facet name="header">  
                                 <h:outputText value="Nome" />  
                             </f:facet>  
                             <h:outputText value="#{membro.nome}" />  
                         </p:column>  

                         <p:column>  
                             <f:facet name="header">  
                                 <h:outputText value="Ação" />  
                             </f:facet>  
                             <h:commandLink action="#{membroMB.editar}" >
                                 <h:graphicImage library="imagens" name="edit.ico" alt="Editar" title="Editar"/>
                             </h:commandLink>
                             <h:commandLink action="#{membroMB.remover}" >
                                 <h:graphicImage library="imagens" name="delete.ico" alt="Remover" title="Remover"/>
                             </h:commandLink> 
                         </p:column>  

                    </p:dataTable> 
                    <!-- END - tabela prime faces -->
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
